import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import Find from '@/views/Find'
import Mine from '@/views/Mine'
import Published from '@/views/Mine/Published'
import Consult from '@/views/Consult'
import Login from '@/views/Login'
import Map from '@/views/Map'
import Add from '@/views/Add'
import AddSeach from '@/views/Add/Seach'
import Detail from '@/views/Detail'
import Collect from '@/views/Collect'
import CityList from '@/views/Find/components/CityList.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/Layout'
  },
  {
    path: '/Layout',
    component: Layout,
    redirect: '/Home',
    children: [
      {
        path: '/Home',
        component: Home
      },
      {
        path: '/Find',
        component: Find
      },
      {
        path: '/Mine',
        component: Mine
      },
      {
        path: '/Consult',
        component: Consult
      }
    ]
  },
  {
    path: '/Login',
    component: Login
  },
  {
    path: '/CityList',
    component: CityList
  },
  // 地图
  {
    path: '/Map',
    component: Map
  },
  // 收藏
  {
    path: '/Collect',
    component: Collect
  },
  // 发布
  {
    path: '/Add',
    component: Add
  },
  // 房屋详细信息
  {
    path: '/Detail',
    component: Detail
  },
  // 发布里的搜索
  {
    path: '/AddSeach',
    component: AddSeach
  },
  // 我的发布
  {
    path: '/Published',
    component: Published
  }

]

const router = new VueRouter({
  routes
})

export default router
